﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using MODEL;

public partial class LoginByAjax : System.Web.UI.Page
{
    protected string strNameErr = "hid";
    protected string strPwdErr = "hid";
    protected void Page_Load(object sender, EventArgs e)
    {
        string uName = Request.Form["uName"];
        string uPwd = Request.Form["uPwd"];
        string reslut = "-1";
        if (!string.IsNullOrEmpty(uName) || !string.IsNullOrEmpty(uPwd))
        {
            StudentModel model = new StudentBLL().QueryByCondition(uName, uPwd);
            if (model != null)
            {
                Session["Sid"] = model.SID;
                reslut = "1";
            }
            Response.Write(reslut);
            Response.End();
        }
    }
}